/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * VentNuevaPartida.java
 *
 * Created on 11-may-2010, 12:10:27
 */

package Blackjack;

import java.awt.Dimension;
import java.awt.FileDialog;
import java.awt.Toolkit;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JOptionPane;

/**
 *
 * @author Red
 */
public class VentNuevaPartida extends javax.swing.JFrame {

    private DriverSesion DS;

    /** Creates new form VentNuevaPartida */
    public VentNuevaPartida(DriverSesion ds) {
        DS = ds;
        initComponents();
        Toolkit tk = Toolkit.getDefaultToolkit();
        Dimension screenSize = tk.getScreenSize();
        int screenHeight = screenSize.height;
        int screenWidth = screenSize.width;
        this.setLocation((screenWidth - this.getWidth())/2, (screenHeight - this.getHeight())/2);
        this.setVisible(true);
    }

    public boolean esEnter(String i) {
        try {
            Integer.parseInt(i);
            return true;
        }
        catch(NumberFormatException nfe) {
            return false;
        }
    }

    public List getNombres() {
        List l = new ArrayList();
        int njug = 0;
        if (DesplTipo1.getSelectedIndex() != 0) ++njug;
        if (DespTipo2.getSelectedIndex() != 0) ++njug;
        if (DespTipo3.getSelectedIndex() != 0) ++njug;
        if (DespTipo4.getSelectedIndex() != 0) ++njug;
        if (DespTipo5.getSelectedIndex() != 0) ++njug;
        if (DespTipo6.getSelectedIndex() != 0) ++njug;
        if (DespTipo7.getSelectedIndex() != 0) ++njug;
        if (DespTipo8.getSelectedIndex() != 0) ++njug;
        l.add(njug);
        if (DesplTipo1.getSelectedIndex() != 0) {
            l.add(TextFNom1.getText());
            l.add(Integer.parseInt(TextFDin.getText()));
        }
        if (DespTipo2.getSelectedIndex() != 0) {
            l.add(TextFNom2.getText());
            l.add(Integer.parseInt(TextFDin.getText()));
        }
        if (DespTipo3.getSelectedIndex() != 0) {
            l.add(TextFNom3.getText());
            l.add(Integer.parseInt(TextFDin.getText()));
        }
        if (DespTipo4.getSelectedIndex() != 0) {
            l.add(TextFNom4.getText());
            l.add(Integer.parseInt(TextFDin.getText()));
        }
        if (DespTipo5.getSelectedIndex() != 0) {
            l.add(TextFNom5.getText());
            l.add(Integer.parseInt(TextFDin.getText()));
        }
        if (DespTipo6.getSelectedIndex() != 0) {
            l.add(TextFNom6.getText());
            l.add(Integer.parseInt(TextFDin.getText()));
        }
        if (DespTipo7.getSelectedIndex() != 0) {
            l.add(TextFNom7.getText());
            l.add(Integer.parseInt(TextFDin.getText()));
        }
        if (DesplTipo1.getSelectedIndex() != 0) {
            l.add(TextFNom8.getText());
            l.add(Integer.parseInt(TextFDin.getText()));
        }
        return l;
    }

    public List getConf() {
        List l = new ArrayList();
        l.add("nombre");
        int nbar;
        if (DespNBar.getSelectedIndex() == 0) nbar = 1;
        else if (DespNBar.getSelectedIndex() == 1) nbar = 2;
        else if (DespNBar.getSelectedIndex() == 2) nbar = 4;
        else nbar = 8;
        l.add(nbar);
        int njug = 0;
        if (DesplTipo1.getSelectedIndex() != 0) ++njug;
        if (DespTipo2.getSelectedIndex() != 0) ++njug;
        if (DespTipo3.getSelectedIndex() != 0) ++njug;
        if (DespTipo4.getSelectedIndex() != 0) ++njug;
        if (DespTipo5.getSelectedIndex() != 0) ++njug;
        if (DespTipo6.getSelectedIndex() != 0) ++njug;
        if (DespTipo7.getSelectedIndex() != 0) ++njug;
        if (DespTipo8.getSelectedIndex() != 0) ++njug;
        l.add(njug);
        int tipo = DespPart.getSelectedIndex();
        l.add(tipo);
        if (tipo == 0) l.add(Integer.parseInt(TextFCoef.getText()));
        else if (tipo == 1) l.add(Integer.parseInt(TextFMax.getText()));
        l.add(Integer.parseInt(TextFDin.getText()));
        if (DesplTipo1.getSelectedIndex() != 0) {
            boolean maquina = false;
            if (DesplTipo1.getSelectedIndex() == 2) maquina = true;
            l.add(maquina);
            l.add(TextFNom1.getText());
            if (maquina) l.add(TextFEst1.getText());
        }
        if (DespTipo2.getSelectedIndex() != 0) {
            boolean maquina = false;
            if (DespTipo2.getSelectedIndex() == 2) maquina = true;
            l.add(maquina);
            l.add(TextFNom2.getText());
            if (maquina) l.add(TextFEst2.getText());
        }
        if (DespTipo3.getSelectedIndex() != 0) {
            boolean maquina = false;
            if (DespTipo3.getSelectedIndex() == 2) maquina = true;
            l.add(maquina);
            l.add(TextFNom3.getText());
            if (maquina) l.add(TextFEst3.getText());
        }
        if (DespTipo4.getSelectedIndex() != 0) {
            boolean maquina = false;
            if (DespTipo4.getSelectedIndex() == 2) maquina = true;
            l.add(maquina);
            l.add(TextFNom4.getText());
            if (maquina) l.add(TextFEst4.getText());
        }
        if (DespTipo5.getSelectedIndex() != 0) {
            boolean maquina = false;
            if (DespTipo5.getSelectedIndex() == 2) maquina = true;
            l.add(maquina);
            l.add(TextFNom5.getText());
            if (maquina) l.add(TextFEst5.getText());
        }
        if (DespTipo6.getSelectedIndex() != 0) {
            boolean maquina = false;
            if (DespTipo6.getSelectedIndex() == 2) maquina = true;
            l.add(maquina);
            l.add(TextFNom6.getText());
            if (maquina) l.add(TextFEst6.getText());
        }
        if (DespTipo7.getSelectedIndex() != 0) {
            boolean maquina = false;
            if (DespTipo7.getSelectedIndex() == 2) maquina = true;
            l.add(maquina);
            l.add(TextFNom7.getText());
            if (maquina) l.add(TextFEst7.getText());
        }
        if (DespTipo8.getSelectedIndex() != 0) {
            boolean maquina = false;
            if (DespTipo8.getSelectedIndex() == 2) maquina = true;
            l.add(maquina);
            l.add(TextFNom8.getText());
            if (maquina) l.add(TextFEst8.getText());
        }
        return l;
    }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        DesplTipo1 = new javax.swing.JComboBox();
        TextFNom1 = new javax.swing.JTextField();
        TextFEst1 = new javax.swing.JTextField();
        BotonEst1 = new javax.swing.JButton();
        DespTipo2 = new javax.swing.JComboBox();
        TextFNom2 = new javax.swing.JTextField();
        BotonEst2 = new javax.swing.JButton();
        TextFEst2 = new javax.swing.JTextField();
        DespTipo3 = new javax.swing.JComboBox();
        TextFNom3 = new javax.swing.JTextField();
        BotonEst3 = new javax.swing.JButton();
        TextFEst3 = new javax.swing.JTextField();
        DespTipo4 = new javax.swing.JComboBox();
        TextFNom4 = new javax.swing.JTextField();
        BotonEst4 = new javax.swing.JButton();
        TextFEst4 = new javax.swing.JTextField();
        DespTipo5 = new javax.swing.JComboBox();
        TextFEst7 = new javax.swing.JTextField();
        DespTipo8 = new javax.swing.JComboBox();
        TextFEst8 = new javax.swing.JTextField();
        TextFNom8 = new javax.swing.JTextField();
        BotonEst8 = new javax.swing.JButton();
        BotonEst7 = new javax.swing.JButton();
        TextFEst6 = new javax.swing.JTextField();
        BotonEst6 = new javax.swing.JButton();
        TextFNom7 = new javax.swing.JTextField();
        DespTipo7 = new javax.swing.JComboBox();
        DespTipo6 = new javax.swing.JComboBox();
        TextFNom6 = new javax.swing.JTextField();
        TextFNom5 = new javax.swing.JTextField();
        BotonEst5 = new javax.swing.JButton();
        TextFEst5 = new javax.swing.JTextField();
        jSeparator1 = new javax.swing.JSeparator();
        TextFMax = new javax.swing.JTextField();
        TextFDin = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        DespNBar = new javax.swing.JComboBox();
        BotonCerrar = new javax.swing.JButton();
        BotonEmpezar = new javax.swing.JButton();
        jLabel8 = new javax.swing.JLabel();
        TextFCoef = new javax.swing.JTextField();
        DespPart = new javax.swing.JComboBox();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Nueva Partida");
        setResizable(false);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                formWindowClosing(evt);
            }
        });

        jLabel1.setText("Tipo");

        jLabel2.setText("Nombre");

        jLabel3.setText("Estrategia");

        DesplTipo1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Vacío", "Humano", "Máquina" }));
        DesplTipo1.setSelectedIndex(1);
        DesplTipo1.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                DesplTipo1ItemStateChanged(evt);
            }
        });
        DesplTipo1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                DesplTipo1ActionPerformed(evt);
            }
        });

        TextFNom1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TextFNom1ActionPerformed(evt);
            }
        });

        TextFEst1.setEditable(false);
        TextFEst1.setDisabledTextColor(new java.awt.Color(0, 0, 0));
        TextFEst1.setEnabled(false);
        TextFEst1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TextFEst1ActionPerformed(evt);
            }
        });

        BotonEst1.setText("Estrategia...");
        BotonEst1.setEnabled(false);
        BotonEst1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotonEst1ActionPerformed(evt);
            }
        });

        DespTipo2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Vacío", "Humano", "Máquina" }));
        DespTipo2.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                DespTipo2ItemStateChanged(evt);
            }
        });
        DespTipo2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                DespTipo2ActionPerformed(evt);
            }
        });

        TextFNom2.setEditable(false);

        BotonEst2.setText("Estrategia...");
        BotonEst2.setEnabled(false);
        BotonEst2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotonEst2ActionPerformed(evt);
            }
        });

        TextFEst2.setEditable(false);
        TextFEst2.setDisabledTextColor(new java.awt.Color(0, 0, 0));
        TextFEst2.setEnabled(false);

        DespTipo3.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Vacío", "Humano", "Máquina" }));
        DespTipo3.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                DespTipo3ItemStateChanged(evt);
            }
        });
        DespTipo3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                DespTipo3ActionPerformed(evt);
            }
        });

        TextFNom3.setEditable(false);

        BotonEst3.setText("Estrategia...");
        BotonEst3.setEnabled(false);
        BotonEst3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotonEst3ActionPerformed(evt);
            }
        });

        TextFEst3.setEditable(false);
        TextFEst3.setDisabledTextColor(new java.awt.Color(0, 0, 0));
        TextFEst3.setEnabled(false);

        DespTipo4.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Vacío", "Humano", "Máquina" }));
        DespTipo4.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                DespTipo4ItemStateChanged(evt);
            }
        });
        DespTipo4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                DespTipo4ActionPerformed(evt);
            }
        });

        TextFNom4.setEditable(false);

        BotonEst4.setText("Estrategia...");
        BotonEst4.setEnabled(false);
        BotonEst4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotonEst4ActionPerformed(evt);
            }
        });

        TextFEst4.setEditable(false);
        TextFEst4.setDisabledTextColor(new java.awt.Color(0, 0, 0));
        TextFEst4.setEnabled(false);

        DespTipo5.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Vacío", "Humano", "Máquina" }));
        DespTipo5.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                DespTipo5ItemStateChanged(evt);
            }
        });
        DespTipo5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                DespTipo5ActionPerformed(evt);
            }
        });

        TextFEst7.setEditable(false);
        TextFEst7.setDisabledTextColor(new java.awt.Color(0, 0, 0));
        TextFEst7.setEnabled(false);

        DespTipo8.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Vacío", "Humano", "Máquina" }));
        DespTipo8.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                DespTipo8ItemStateChanged(evt);
            }
        });
        DespTipo8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                DespTipo8ActionPerformed(evt);
            }
        });

        TextFEst8.setEditable(false);
        TextFEst8.setDisabledTextColor(new java.awt.Color(0, 0, 0));
        TextFEst8.setEnabled(false);
        TextFEst8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TextFEst8ActionPerformed(evt);
            }
        });

        TextFNom8.setEditable(false);

        BotonEst8.setText("Estrategia...");
        BotonEst8.setEnabled(false);
        BotonEst8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotonEst8ActionPerformed(evt);
            }
        });

        BotonEst7.setText("Estrategia...");
        BotonEst7.setEnabled(false);
        BotonEst7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotonEst7ActionPerformed(evt);
            }
        });

        TextFEst6.setEditable(false);
        TextFEst6.setDisabledTextColor(new java.awt.Color(0, 0, 0));
        TextFEst6.setEnabled(false);

        BotonEst6.setText("Estrategia...");
        BotonEst6.setEnabled(false);
        BotonEst6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotonEst6ActionPerformed(evt);
            }
        });

        TextFNom7.setEditable(false);

        DespTipo7.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Vacío", "Humano", "Máquina" }));
        DespTipo7.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                DespTipo7ItemStateChanged(evt);
            }
        });
        DespTipo7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                DespTipo7ActionPerformed(evt);
            }
        });

        DespTipo6.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Vacío", "Humano", "Máquina" }));
        DespTipo6.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                DespTipo6ItemStateChanged(evt);
            }
        });
        DespTipo6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                DespTipo6ActionPerformed(evt);
            }
        });

        TextFNom6.setEditable(false);

        TextFNom5.setEditable(false);

        BotonEst5.setText("Estrategia...");
        BotonEst5.setEnabled(false);
        BotonEst5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotonEst5ActionPerformed(evt);
            }
        });

        TextFEst5.setEditable(false);
        TextFEst5.setDisabledTextColor(new java.awt.Color(0, 0, 0));
        TextFEst5.setEnabled(false);

        TextFMax.setEditable(false);
        TextFMax.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        TextFMax.setText("100");
        TextFMax.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TextFMaxActionPerformed(evt);
            }
        });

        TextFDin.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        TextFDin.setText("1000");
        TextFDin.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TextFDinActionPerformed(evt);
            }
        });

        jLabel4.setText("Núm. máximo de manos:");

        jLabel5.setText("Dinero inicial:");

        jLabel6.setText("Núm de barajas:");

        jLabel7.setText("Tipo de partida:");

        DespNBar.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "1", "2", "4", "8" }));

        BotonCerrar.setText("Cerrar");
        BotonCerrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotonCerrarActionPerformed(evt);
            }
        });

        BotonEmpezar.setText("Empezar");
        BotonEmpezar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotonEmpezarActionPerformed(evt);
            }
        });

        jLabel8.setText("Coeficiente:");

        TextFCoef.setText("5");
        TextFCoef.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TextFCoefActionPerformed(evt);
            }
        });

        DespPart.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Límite dinero", "Límite manos", "Libre" }));
        DespPart.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                DespPartActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                .addComponent(jLabel5)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 65, Short.MAX_VALUE)
                                .addComponent(TextFDin, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel6)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 71, Short.MAX_VALUE)
                                .addComponent(DespNBar, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel7)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 33, Short.MAX_VALUE)
                                .addComponent(DespPart, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                .addComponent(jLabel4)
                                .addGap(14, 14, 14)
                                .addComponent(TextFMax, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                .addComponent(jLabel8)
                                .addGap(73, 73, 73)
                                .addComponent(TextFCoef, javax.swing.GroupLayout.DEFAULT_SIZE, 45, Short.MAX_VALUE))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(BotonEmpezar)
                                .addGap(18, 18, 18)
                                .addComponent(BotonCerrar))))
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(jSeparator1)
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                            .addGap(28, 28, 28)
                            .addComponent(jLabel1)
                            .addGap(65, 65, 65)
                            .addComponent(jLabel2)
                            .addGap(61, 61, 61)
                            .addComponent(jLabel3))
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                            .addComponent(DesplTipo1, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(TextFNom1, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(TextFEst1, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(BotonEst1))
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                            .addComponent(DespTipo2, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(TextFNom2, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(TextFEst2, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(BotonEst2))
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                            .addComponent(DespTipo3, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(TextFNom3, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(TextFEst3, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(BotonEst3))
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                            .addComponent(DespTipo4, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(TextFNom4, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(TextFEst4, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(BotonEst4))
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                            .addComponent(DespTipo5, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(TextFNom5, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(TextFEst5, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(BotonEst5))
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                            .addComponent(DespTipo6, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(TextFNom6, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(TextFEst6, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(BotonEst6))
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                            .addComponent(DespTipo7, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(TextFNom7, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(TextFEst7, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(BotonEst7))
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                            .addComponent(DespTipo8, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(TextFNom8, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(TextFEst8, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(BotonEst8))))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jLabel3)
                    .addComponent(jLabel1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(DesplTipo1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TextFNom1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TextFEst1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(BotonEst1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(DespTipo2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TextFNom2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TextFEst2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(BotonEst2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(DespTipo3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TextFNom3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TextFEst3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(BotonEst3))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(DespTipo4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TextFNom4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TextFEst4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(BotonEst4))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(DespTipo5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TextFNom5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TextFEst5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(BotonEst5))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(DespTipo6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TextFNom6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TextFEst6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(BotonEst6))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(DespTipo7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TextFNom7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TextFEst7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(BotonEst7))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(DespTipo8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TextFNom8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TextFEst8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(BotonEst8))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(2, 2, 2)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(TextFDin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel4)
                    .addComponent(TextFMax, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(DespNBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6)
                    .addComponent(jLabel8)
                    .addComponent(TextFCoef, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(DespPart, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel7)
                    .addComponent(BotonCerrar)
                    .addComponent(BotonEmpezar))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void BotonCerrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotonCerrarActionPerformed
        // TODO add your handling code here:
        DS.S.volverAlMenu();
        this.dispose();
    }//GEN-LAST:event_BotonCerrarActionPerformed

    private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
        // TODO add your handling code here:
        DS.S.volverAlMenu();
    }//GEN-LAST:event_formWindowClosing

    private void DesplTipo1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_DesplTipo1ActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_DesplTipo1ActionPerformed

    private void DespTipo2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_DespTipo2ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_DespTipo2ActionPerformed

    private void DespTipo3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_DespTipo3ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_DespTipo3ActionPerformed

    private void DespTipo4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_DespTipo4ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_DespTipo4ActionPerformed

    private void DespTipo5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_DespTipo5ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_DespTipo5ActionPerformed

    private void DespTipo6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_DespTipo6ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_DespTipo6ActionPerformed

    private void DespTipo7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_DespTipo7ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_DespTipo7ActionPerformed

    private void DespTipo8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_DespTipo8ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_DespTipo8ActionPerformed

    private void DesplTipo1ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_DesplTipo1ItemStateChanged
        // TODO add your handling code here:
        
        if (DesplTipo1.getSelectedIndex() == 1) {
            TextFNom1.setEditable(true);
            TextFEst1.setEditable(false);
            BotonEst1.setEnabled(false);
        }
        else if (DesplTipo1.getSelectedIndex() == 2) {
            TextFNom1.setEditable(true);
            TextFEst1.setEditable(true);
            BotonEst1.setEnabled(true);
        }
        else {
            TextFNom1.setEditable(false);
            TextFEst1.setEditable(false);
            BotonEst1.setEnabled(false);
        }
}//GEN-LAST:event_DesplTipo1ItemStateChanged

    private void TextFNom1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TextFNom1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_TextFNom1ActionPerformed

    private void TextFEst1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TextFEst1ActionPerformed
        // TODO add your handling code here:
        
    }//GEN-LAST:event_TextFEst1ActionPerformed

    private void TextFDinActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TextFDinActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_TextFDinActionPerformed

    private void DespTipo2ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_DespTipo2ItemStateChanged
        // TODO add your handling code here:
        if (DespTipo2.getSelectedIndex() == 1) {
            TextFNom2.setEditable(true);
            TextFEst2.setEditable(false);
            BotonEst2.setEnabled(false);
        }
        else if (DespTipo2.getSelectedIndex() == 2) {
            TextFNom2.setEditable(true);
            TextFEst2.setEditable(true);
            BotonEst2.setEnabled(true);
        }
        else {
            TextFNom2.setEditable(false);
            TextFEst2.setEditable(false);
            BotonEst2.setEnabled(false);
        }
    }//GEN-LAST:event_DespTipo2ItemStateChanged

    private void DespTipo3ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_DespTipo3ItemStateChanged
        // TODO add your handling code here:
        if (DespTipo3.getSelectedIndex() == 1) {
            TextFNom3.setEditable(true);
            TextFEst3.setEditable(false);
            BotonEst3.setEnabled(false);
        }
        else if (DespTipo3.getSelectedIndex() == 2) {
            TextFNom3.setEditable(true);
            TextFEst3.setEditable(true);
            BotonEst3.setEnabled(true);
        }
        else {
            TextFNom3.setEditable(false);
            TextFEst3.setEditable(false);
            BotonEst3.setEnabled(false);
        }
    }//GEN-LAST:event_DespTipo3ItemStateChanged

    private void DespTipo4ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_DespTipo4ItemStateChanged
        // TODO add your handling code here:
        if (DespTipo4.getSelectedIndex() == 1) {
            TextFNom4.setEditable(true);
            TextFEst4.setEditable(false);
            BotonEst4.setEnabled(false);
        }
        else if (DespTipo4.getSelectedIndex() == 2) {
            TextFNom4.setEditable(true);
            TextFEst4.setEditable(true);
            BotonEst4.setEnabled(true);
        }
        else {
            TextFNom4.setEditable(false);
            TextFEst4.setEditable(false);
            BotonEst4.setEnabled(false);
        }
    }//GEN-LAST:event_DespTipo4ItemStateChanged

    private void DespTipo5ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_DespTipo5ItemStateChanged
        // TODO add your handling code here:
        if (DespTipo5.getSelectedIndex() == 1) {
            TextFNom5.setEditable(true);
            TextFEst5.setEditable(false);
            BotonEst5.setEnabled(false);
        }
        else if (DespTipo5.getSelectedIndex() == 2) {
            TextFNom5.setEditable(true);
            TextFEst5.setEditable(true);
            BotonEst5.setEnabled(true);
        }
        else {
            TextFNom5.setEditable(false);
            TextFEst5.setEditable(false);
            BotonEst5.setEnabled(false);
        }
    }//GEN-LAST:event_DespTipo5ItemStateChanged

    private void DespTipo6ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_DespTipo6ItemStateChanged
        // TODO add your handling code here:
        if (DespTipo6.getSelectedIndex() == 1) {
            TextFNom6.setEditable(true);
            TextFEst6.setEditable(false);
            BotonEst6.setEnabled(false);
        }
        else if (DespTipo6.getSelectedIndex() == 2) {
            TextFNom6.setEditable(true);
            TextFEst6.setEditable(true);
            BotonEst6.setEnabled(true);
        }
        else {
            TextFNom6.setEditable(false);
            TextFEst6.setEditable(false);
            BotonEst6.setEnabled(false);
        }
    }//GEN-LAST:event_DespTipo6ItemStateChanged

    private void DespTipo7ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_DespTipo7ItemStateChanged
        // TODO add your handling code here:
        if (DespTipo7.getSelectedIndex() == 1) {
            TextFNom7.setEditable(true);
            TextFEst7.setEditable(false);
            BotonEst7.setEnabled(false);
        }
        else if (DespTipo7.getSelectedIndex() == 2) {
            TextFNom7.setEditable(true);
            TextFEst7.setEditable(true);
            BotonEst7.setEnabled(true);
        }
        else {
            TextFNom7.setEditable(false);
            TextFEst7.setEditable(false);
            BotonEst7.setEnabled(false);
        }
    }//GEN-LAST:event_DespTipo7ItemStateChanged

    private void DespTipo8ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_DespTipo8ItemStateChanged
        // TODO add your handling code here:
        if (DespTipo8.getSelectedIndex() == 1) {
            TextFNom8.setEditable(true);
            TextFEst8.setEditable(false);
            BotonEst8.setEnabled(false);
        }
        else if (DespTipo8.getSelectedIndex() == 2) {
            TextFNom8.setEditable(true);
            TextFEst8.setEditable(true);
            BotonEst8.setEnabled(true);
        }
        else {
            TextFNom8.setEditable(false);
            TextFEst8.setEditable(false);
            BotonEst8.setEnabled(false);
        }
    }//GEN-LAST:event_DespTipo8ItemStateChanged

    private void BotonEst1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotonEst1ActionPerformed
        // TODO add your handling code here:
        FileDialog fd = new FileDialog(this, "Abrir Estrategia...", FileDialog.LOAD);
        fd.setLocation(50, 50);
        fd.show();
        if (fd.getFile() != null) {
            TextFEst1.setText(fd.getDirectory() + fd.getFile());
        }
    }//GEN-LAST:event_BotonEst1ActionPerformed

    private void BotonEst2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotonEst2ActionPerformed
        // TODO add your handling code here:
        FileDialog fd = new FileDialog(this, "Abrir Estrategia...", FileDialog.LOAD);
        fd.setLocation(50, 50);
        fd.show();
        if (fd.getFile() != null) {
            TextFEst2.setText(fd.getDirectory() + fd.getFile());
        }
    }//GEN-LAST:event_BotonEst2ActionPerformed

    private void BotonEst3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotonEst3ActionPerformed
        // TODO add your handling code here:
        FileDialog fd = new FileDialog(this, "Abrir Estrategia...", FileDialog.LOAD);
        fd.setLocation(50, 50);
        fd.show();
        if (fd.getFile() != null) {
            TextFEst3.setText(fd.getDirectory() + fd.getFile());
        }
    }//GEN-LAST:event_BotonEst3ActionPerformed

    private void BotonEst4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotonEst4ActionPerformed
        // TODO add your handling code here:
        FileDialog fd = new FileDialog(this, "Abrir Estrategia...", FileDialog.LOAD);
        fd.setLocation(50, 50);
        fd.show();
        if (fd.getFile() != null) {
            TextFEst4.setText(fd.getDirectory() + fd.getFile());
        }
    }//GEN-LAST:event_BotonEst4ActionPerformed

    private void BotonEst5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotonEst5ActionPerformed
        // TODO add your handling code here:
        FileDialog fd = new FileDialog(this, "Abrir Estrategia...", FileDialog.LOAD);
        fd.setLocation(50, 50);
        fd.show();
        if (fd.getFile() != null) {
            TextFEst5.setText(fd.getDirectory() + fd.getFile());
        }
    }//GEN-LAST:event_BotonEst5ActionPerformed

    private void BotonEst6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotonEst6ActionPerformed
        // TODO add your handling code here:
        FileDialog fd = new FileDialog(this, "Abrir Estrategia...", FileDialog.LOAD);
        fd.setLocation(50, 50);
        fd.show();
        if (fd.getFile() != null) {
            TextFEst6.setText(fd.getDirectory() + fd.getFile());
        }
    }//GEN-LAST:event_BotonEst6ActionPerformed

    private void BotonEst7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotonEst7ActionPerformed
        // TODO add your handling code here:
        FileDialog fd = new FileDialog(this, "Abrir Estrategia...", FileDialog.LOAD);
        fd.setLocation(50, 50);
        fd.show();
        if (fd.getFile() != null) {
            TextFEst7.setText(fd.getDirectory() + fd.getFile());
        }
    }//GEN-LAST:event_BotonEst7ActionPerformed

    private void BotonEst8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotonEst8ActionPerformed
        // TODO add your handling code here:
        FileDialog fd = new FileDialog(this, "Abrir Estrategia...", FileDialog.LOAD);
        fd.setLocation(50, 50);
        fd.show();
        if (fd.getFile() != null) {
            TextFEst8.setText(fd.getDirectory() + fd.getFile());
        }
    }//GEN-LAST:event_BotonEst8ActionPerformed

    private void BotonEmpezarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotonEmpezarActionPerformed
        // TODO add your handling code here:
        List l = new ArrayList();
        if (!esEnter(TextFDin.getText())) {
            JOptionPane.showMessageDialog(this, "El Dinero tiene que estar entre 1000 y 1000000.",
            "Message", JOptionPane.WARNING_MESSAGE);
             this.setEnabled(true);
             return;
        }
        if (!esEnter(TextFCoef.getText())) {
            JOptionPane.showMessageDialog(this, "El Coeficiente tiene que estar entre 2 y 100.",
            "Message", JOptionPane.WARNING_MESSAGE);
             this.setEnabled(true);
             return;
        }
        if (!esEnter(TextFMax.getText())) {
            JOptionPane.showMessageDialog(this, "El número de manos tiene que estar entre 1 y 1000.",
            "Message", JOptionPane.WARNING_MESSAGE);
             this.setEnabled(true);
             return;
        }
        l = getNombres();
        int n = (Integer) l.remove(0);
        List aux = new ArrayList();
        for (int i = 0; i < n*2; i += 2) {
            if (((String)l.get(i)).equals("")) {
                JOptionPane.showMessageDialog(this, "El nombre no puede ser vacío.",
                "Message", JOptionPane.WARNING_MESSAGE);
                this.setEnabled(true);
                return;
            }
            for (int j = 0; j < aux.size(); ++j) {
                if (((String)l.get(i)).equals((String)aux.get(j))) {
                    JOptionPane.showMessageDialog(this, "No puede haber nombres repetidos.",
                    "Message", JOptionPane.WARNING_MESSAGE);
                    this.setEnabled(true);
                    return;
                }
            }
            aux.add(l.get(i));
        }
        if ((Integer) l.get(1) < 1000 || (Integer) l.get(1) > 1000000) {
            JOptionPane.showMessageDialog(this, "El Dinero tiene que estar entre 1000 y 1000000.",
            "Message", JOptionPane.WARNING_MESSAGE);
             this.setEnabled(true);
             return;
        }
        if (Integer.parseInt(TextFCoef.getText()) < 2 || Integer.parseInt(TextFCoef.getText()) > 100) {
            JOptionPane.showMessageDialog(this, "El Coeficiente tiene que estar entre 2 y 100.",
            "Message", JOptionPane.WARNING_MESSAGE);
             this.setEnabled(true);
             return;
        }
        if (Integer.parseInt(TextFMax.getText()) < 2 || Integer.parseInt(TextFMax.getText()) > 100) {
            JOptionPane.showMessageDialog(this, "El número de manos tiene que estar entre 1 y 1000.",
            "Message", JOptionPane.WARNING_MESSAGE);
             this.setEnabled(true);
             return;
        }
        if (DesplTipo1.getSelectedIndex() == 2) {
            if (TextFEst1.getText().equals("")) {
                JOptionPane.showMessageDialog(this, "El jugador máquina tiene que tener Estrategia.",
                "Message", JOptionPane.WARNING_MESSAGE);
                this.setEnabled(true);
                return;
            }
        }
        if (DespTipo2.getSelectedIndex() == 2) {
            if (TextFEst2.getText().equals("")) {
                JOptionPane.showMessageDialog(this, "El jugador máquina tiene que tener Estrategia.",
                "Message", JOptionPane.WARNING_MESSAGE);
                this.setEnabled(true);
                return;
            }
        }
        if (DespTipo3.getSelectedIndex() == 2) {
            if (TextFEst3.getText().equals("")) {
                JOptionPane.showMessageDialog(this, "El jugador máquina tiene que tener Estrategia.",
                "Message", JOptionPane.WARNING_MESSAGE);
                this.setEnabled(true);
                return;
            }
        }
        if (DespTipo4.getSelectedIndex() == 2) {
            if (TextFEst4.getText().equals("")) {
                JOptionPane.showMessageDialog(this, "El jugador máquina tiene que tener Estrategia.",
                "Message", JOptionPane.WARNING_MESSAGE);
                this.setEnabled(true);
                return;
            }
        }
        if (DespTipo5.getSelectedIndex() == 2) {
            if (TextFEst5.getText().equals("")) {
                JOptionPane.showMessageDialog(this, "El jugador máquina tiene que tener Estrategia.",
                "Message", JOptionPane.WARNING_MESSAGE);
                this.setEnabled(true);
                return;
            }
        }
        if (DespTipo6.getSelectedIndex() == 2) {
            if (TextFEst6.getText().equals("")) {
                JOptionPane.showMessageDialog(this, "El jugador máquina tiene que tener Estrategia.",
                "Message", JOptionPane.WARNING_MESSAGE);
                this.setEnabled(true);
                return;
            }
        }
        if (DespTipo7.getSelectedIndex() == 2) {
            if (TextFEst7.getText().equals("")) {
                JOptionPane.showMessageDialog(this, "El jugador máquina tiene que tener Estrategia.",
                "Message", JOptionPane.WARNING_MESSAGE);
                this.setEnabled(true);
                return;
            }
        }
        if (DespTipo8.getSelectedIndex() == 2) {
            if (TextFEst8.getText().equals("")) {
                JOptionPane.showMessageDialog(this, "El jugador máquina tiene que tener Estrategia.",
                "Message", JOptionPane.WARNING_MESSAGE);
                this.setEnabled(true);
                return;
            }
        }
        this.setEnabled(false);
        DS.iniciarPartida();
    }//GEN-LAST:event_BotonEmpezarActionPerformed

    private void DespPartActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_DespPartActionPerformed
        // TODO add your handling code here:
        if (DespPart.getSelectedIndex() == 0) {
            TextFMax.setEditable(false);
            TextFCoef.setEditable(true);
        }
        else if (DespPart.getSelectedIndex() == 1) {
            TextFMax.setEditable(true);
            TextFCoef.setEditable(false);
        }
        else {
            TextFMax.setEditable(false);
            TextFCoef.setEditable(false);
        }
    }//GEN-LAST:event_DespPartActionPerformed

    private void TextFCoefActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TextFCoefActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_TextFCoefActionPerformed

    private void TextFMaxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TextFMaxActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_TextFMaxActionPerformed

    private void TextFEst8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TextFEst8ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_TextFEst8ActionPerformed

    /**
    * @param args the command line arguments
    */
    /*public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new VentNuevaPartida().setVisible(true);
            }
        });
    }*/

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton BotonCerrar;
    private javax.swing.JButton BotonEmpezar;
    private javax.swing.JButton BotonEst1;
    private javax.swing.JButton BotonEst2;
    private javax.swing.JButton BotonEst3;
    private javax.swing.JButton BotonEst4;
    private javax.swing.JButton BotonEst5;
    private javax.swing.JButton BotonEst6;
    private javax.swing.JButton BotonEst7;
    private javax.swing.JButton BotonEst8;
    private javax.swing.JComboBox DespNBar;
    private javax.swing.JComboBox DespPart;
    private javax.swing.JComboBox DespTipo2;
    private javax.swing.JComboBox DespTipo3;
    private javax.swing.JComboBox DespTipo4;
    private javax.swing.JComboBox DespTipo5;
    private javax.swing.JComboBox DespTipo6;
    private javax.swing.JComboBox DespTipo7;
    private javax.swing.JComboBox DespTipo8;
    private javax.swing.JComboBox DesplTipo1;
    private javax.swing.JTextField TextFCoef;
    private javax.swing.JTextField TextFDin;
    private javax.swing.JTextField TextFEst1;
    private javax.swing.JTextField TextFEst2;
    private javax.swing.JTextField TextFEst3;
    private javax.swing.JTextField TextFEst4;
    private javax.swing.JTextField TextFEst5;
    private javax.swing.JTextField TextFEst6;
    private javax.swing.JTextField TextFEst7;
    private javax.swing.JTextField TextFEst8;
    private javax.swing.JTextField TextFMax;
    private javax.swing.JTextField TextFNom1;
    private javax.swing.JTextField TextFNom2;
    private javax.swing.JTextField TextFNom3;
    private javax.swing.JTextField TextFNom4;
    private javax.swing.JTextField TextFNom5;
    private javax.swing.JTextField TextFNom6;
    private javax.swing.JTextField TextFNom7;
    private javax.swing.JTextField TextFNom8;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JSeparator jSeparator1;
    // End of variables declaration//GEN-END:variables

}
